<template>
    <section>
    <div>
    <el-descriptions  title="医生注册表">
    <el-descriptions-item label="医师姓名">医师姓名：{{this.Detail.DoctorName}}<br><br></el-descriptions-item>
    <el-descriptions-item label="医师姓名">医师姓名：{{this.Detail.physician}}<br><br></el-descriptions-item>
    <el-descriptions-item label="身份证">身份证号：{{this.Detail.Idcard}}<br><br></el-descriptions-item>
    <el-descriptions-item label="隶属医院">隶属医院：{{this.Detail.Hospital}}<br><br></el-descriptions-item>
    <el-descriptions-item label="联系电话">联系电话：{{this.Detail.Phone}}<br><br></el-descriptions-item>
    <el-descriptions-item colon="false" :span="8" label="身份证">身份证：<img :span="8" :src="src+this.Detail.IdentityCard" width="180px" height="120px" alt=""></el-descriptions-item>
    <el-descriptions-item colon="false" :span="8" label="医师执业证书上传">医师执业证书上传：<img :span="8" :src="src+this.Detail.OccupationCard" width="180px" height="120px" alt=""></el-descriptions-item>
    <el-descriptions-item colon="false" :span="8" label="医师资格证书上传">医师资格证书上传：<img :span="8" :src="src+this.Detail.QualificationCard" width="180px" height="120px" alt=""><br></el-descriptions-item>
    <el-descriptions-item label="审核状态" :span="12">
        <br>
        <el-radio-group v-show="this.Detail.Status==0" v-model="UptData.Status">
      <el-radio :value="1" :label="1">通过</el-radio>
      <el-radio :value="2" :label="2">不通过</el-radio>
    </el-radio-group><br>
    </el-descriptions-item>
    <el-descriptions-item colon="false" :span="12">

<el-input v-if="this.UptData.Status==2" placeholder="不通过原因" style="width: 400px;" v-model="Detail.Cause"></el-input>
<span v-if="this.Detail.Status==2">不通过原因：{{Detail.Cause}}</span><br><br>
</el-descriptions-item>
    <el-descriptions-item>
        <br><span style="color:lightgreen" v-if="this.Detail.Status==1"><b>审核状态:已通过</b></span>
      <span style="color:red" v-if="this.Detail.Status==2"><b>审核状态:未通过</b></span><br><br>
    </el-descriptions-item>   
    
       <el-button v-if="this.Detail.Status==0" @click="AuditEdit">提交</el-button>
      <el-button v-if="this.Detail.Status!=0" @click="AuditList">关闭</el-button><br>
    </el-descriptions>
    </div>
    </section>
</template>
<script>
import {GetAudit,AuditUpt} from "@/api/api";

export default{
    created() {
    console.log("医生Id",this.$route.query)
  },
    data(){
        return{
            tableData:[],
            src:"http://localhost:9291/Imgs/",
            Detail:{
                Id:this.$route.query.id,
                DoctorName:"",
                Idcard:"",
                Phone:"",
                Hospital:"",
                IdentityCard:"",
                QualificationCard:"",
                OccupationCard:"",
                Cause:"",
                Status:undefined,
            },
            UptData:{
                id:this.$route.query.id,
                Status:0,
                Cause:"",
            }
        }
    },
    mounted(){
        this.AuditDetail()
    },
    methods:{
        AuditDetail(){
            let par = {
                id:this.$route.query.id
            }
            GetAudit(par).then((res)=>{
                this.Detail=res.data.response
                console.log("医生信息",res.data.response)
            })
        },
        AuditList(){
            this.$router.push({path:"AuditList"})
        },
        AuditEdit(){
            let par = {
                id:this.UptData.id,
                Status:this.UptData.Status,
                Cause:this.Detail.Cause
            }
            AuditUpt(par).then((res)=>{
                if(res.data.status>0){ 
                    this.$router.push({path:"DoctorList"})
                    this.$message(res.data.msg)
                }
                else{
                    this.$message.error(res.data.msg)
                }
            })
        }
    }
}
</script>

